var _Event = require('component/event.js');

var _interface = {
    resize: function (w, h) {
    },
    /**
     * @param name
     * @param fn
     * @param [bind]
     */
    on: function (name, fn, bind) {
        this.mEvent.on(name, fn, bind);
    },
    /**
     * @param name
     * @param [fn]
     */
    off: function (name, fn) {
        this.mEvent.off.apply(this.mEvent, arguments);
    },
    /**
     * @param name
     * @param [target]
     */
    fire: function (name, target) {
        this.mEvent.fire.apply(this.mEvent, arguments);
    }
}

// ---------------- export
exports.onCreate = function (instance) {
    instance.mEvent = new _Event();
}
exports.asAction = function (clz) {
    for (var i in _interface) {
        clz.prototype[i] || (clz.prototype[i] = _interface[i]);
    }
}